//
// Created by chen on 2023/6/23.
//
#include "student.h"

Student::Student(string id, string name) {
    this->s_id = id;
    this->s_name = name;
}

Student::~Student() {

}

void Student::showMenu() {
    cout << "****************************************" << endl;
    cout << "***********欢迎使用机房预约系统************" << endl;
    cout << "***********   1、申请预约    ************" << endl;
    cout << "***********   2、查看自身预约    *********" << endl;
    cout << "***********   3、查看所有预约   **********" << endl;
    cout << "***********   4、取消预约   *************" << endl;
    cout << "***********   0、注销登录    ************" << endl;
    cout << "***************************************" << endl;
    cout << "请选择:";
}

void Student::applyReservation() {
    string roomId;
    string timeIndex;
    cout << "请输入预约机房ID:";
    cin >> roomId;
    cout << "请输入预约机房时间(周一上午到周五下午为1-10):";
    cin >> timeIndex;
    MachineRoom mr;
    mr.applyReservation(roomId, timeIndex, this->s_name);
}

void Student::showSelfReservation() {
    MachineRoom mr;
    mr.viewSelfReservation(this->s_name);
}

void Student::showAllReservation() {
    MachineRoom mr;
    mr.viewAllReservation();
}

void Student::cancelReservation() {
    string roomId;
    string timeIndex;
    cout << "请输入要取消预约机房ID:";
    cin >> roomId;
    cout << "请输入要取消预约机房时间(周一上午到周五下午为1-10):";
    cin >> timeIndex;
    MachineRoom mr;
    mr.cancelReservation(roomId, timeIndex, this->s_name);
}

void Student::logOut() {
    cout << "已注销登录" << endl;
}
